﻿using Abp.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Ny.Ci.Core.Common;
using Ny.Ci.Core.Mentions;
using Ny.Ci.Core.Points;
using Ny.Ci.Core.Suggestions;
using Ny.Ci.Core.Users;
using System;
using System.Collections.Generic;
using System.Text;

namespace Ny.Ci.EntityFrameworkCore.EntityFrameworkCore
{

    public class CiDbContext : AbpDbContext
    {
        //Add DbSet properties for your entities...

        public CiDbContext(DbContextOptions<CiDbContext> options)
            : base(options)
        {

        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            //移除复数表达
            foreach (var entityType in modelBuilder.Model.GetEntityTypes())
            {
                // Skip shadow types
                if (entityType.ClrType == null)
                    continue;

                entityType.Relational().TableName = entityType.ClrType.Name;
            }
            base.OnModelCreating(modelBuilder);
        }
        public DbSet<MentionInfo> Mentions { get; set; }
        public DbSet<MentionType> MentionTypes { get; set; }
        public DbSet<MentionOperLog> MentionOperLogs { get; set; }
        public DbSet<Suggestion> Suggestions { get; set; }
        public DbSet<SuggestionOperLog> SuggestionOperLogs { get; set; }
        public DbSet<TeamUserLink> TeamUserLinks { get; set; }
        public DbSet<PointsLevel> PointsLevels { get; set; }
        public DbSet<PointsRecord> PointsRecords { get; set; }
        public DbSet<UserPoints> UserPoints { get; set; }
        public DbSet<AttachmentInfo> AttachmentInfos { get; set; }
        public DbSet<HotspotPic> HotspotPics { get; set; }
        public DbSet<User> Users { get; set; }
        public DbSet<Test> Tests { get; set; }
        

    }
}
